﻿//======================================================
//==     (c)2008 aspxcms inc by NeTCMS v1.0              ==
//==          Forum:bbs.aspxcms.com                   ==
//==         Website:www.aspxcms.com                  ==
//======================================================
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using NetCMS.Content;

public partial class manage_channel_preview : NetCMS.Web.UI.ManagePage
{
    Channel rd = new Channel();
    protected void Page_Load(object sender, EventArgs e)
    {
        string Urls = string.Empty;
        string id = Request.QueryString["id"];
        string type = Request.QueryString["type"];
        string ChID =Request.QueryString["ChID"];
        if(ChID!=null&&ChID!=string.Empty)
        {
            if ((id == null && id == string.Empty) || (type == null && type == string.Empty))
            {
                PageError("错误的参数！", "javascript:hitory.back();", true);
            }
            else
            {
                Urls = rd.getUrl(type.ToString(), int.Parse(id.ToString()), int.Parse(ChID.ToString()));
                string urlsreplace = Urls;
                string dirHTML = NetCMS.Common.Public.readCHparamConfig("htmldir", int.Parse(ChID.ToString()));
                dirHTML = dirHTML.Replace("{@dirHTML}", NetCMS.Config.UIConfig.dirHtml);
                if (urlsreplace.IndexOf(".aspx?id=") > -1)
                {
                    Response.Redirect(NetCMS.Publish.CommonData.getUrl() + urlsreplace);
                }
                else
                {
                    urlsreplace = "/" + dirHTML + "/" + urlsreplace;
                    urlsreplace = urlsreplace.Replace("//", "/");
                    Response.Redirect(NetCMS.Publish.CommonData.getUrl() + urlsreplace);
                }
            }
        }
        else
        {
            PageError("频道参数传递错误！", "javascript:hitory.back();", true);
        }
    }
}
